package com.aididi.exception;

import com.aididi.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author ：xuzexiang
 * @description：全局异常处理
 * @date ： 2021/11/4 9:55
 */
@RestControllerAdvice
public class GlabalException {

    @ExceptionHandler(value = Exception.class)
    public R handle(Exception e) {
        return R.error(e.getMessage());
    }

}
